//
//  ContributeViewController.m
//  HorizonLight
//
//  Created by lanou on 15/9/19.
//  Copyright (c) 2015年 lanou. All rights reserved.
//

#import "ContributeViewController.h"
#import "ContributeView.h"

@interface ContributeViewController ()<UITextFieldDelegate>

@property (nonatomic, strong) ContributeView *contributeView;

@end

@implementation ContributeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.contributeView = [[ContributeView alloc] initWithFrame:kBounds];
    [self.view addSubview:self.contributeView];
    
    self.contributeView.nickNameTextField.delegate = self;
    self.contributeView.eMailTextField.delegate = self;
    self.contributeView.videoNameTextField.delegate = self;
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
    if ([_contributeView.nickNameTextField isFirstResponder])
    {
        [_contributeView.eMailTextField becomeFirstResponder];
    }
    else if ([_contributeView.eMailTextField isFirstResponder])
    {
        [_contributeView.videoNameTextField becomeFirstResponder];
    }
    else
    {
        [_contributeView.videoNameTextField resignFirstResponder];
    }
    return NO;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
